package com.entity.product;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("products") // 映射到数据库表名
@ApiModel("产品实体类")
public class Product {

    @ApiModelProperty(value = "产品ID，主键，唯一标识每个产品")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "产品名称，不能为空")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "产品型号")
    @TableField("version")
    private String version;

    @ApiModelProperty(value = "产品规格/口径")
    @TableField("specification")
    private String specification;

    @ApiModelProperty(value = "材质")
    @TableField("material")
    private String material;

    @ApiModelProperty(value = "压力等级（MPa）")
    @TableField("mpa")
    private Float mpa;

    @ApiModelProperty(value = "产品描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "产品价格")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "问题归类")
    @TableField("problem_category")
    private String problemCategory;

    @ApiModelProperty(value = "创建时间，默认为当前时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间，每次更新时自动刷新")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}